<template>
	<view class="">
		<view v-for="(item,index) in HoList" :key="index" class="xuan-item" @tap="goinfo(item)">
			<view class="quan">
				<image :src="item.store_photos[0]" mode=""></image>
			</view>
			<view class="xuan-title">
				<view style="display: flex;justify-content: space-between;">
					<view class="ellipsis1" style="flex: 1;">{{item.hotel_name}}</view>
					<view v-if="type == 1" style="width: 100rpx;font-size: 24rpx;color: #FF5720;text-align: right;padding-right: 30rpx;">￥{{item.balance}}</view>
					<view v-if="type == 2" style="width: 100rpx;font-size: 24rpx;color: #FF5720;text-align: right;padding-right: 30rpx;">￥{{item.bond}}</view>
				</view>
				<view class="xuan-address ellipsis1">{{item.address}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				HoList: [],
				type: ''
			}
		},
		onLoad(options) {
			this.type = options.type
		},
		onShow() {
			this.getList()
		},
		methods:{
			getList(){
				const params = {
					
				}
				this.$http.post('/index/Hotelpersonal/hotellist', params).then(res => {
					this.HoList = res
				}).catch(res => {
					uni.hideLoading()
					uni.showToast({
						title: res.errMsg,
						icon: "none"
					})
				})
			},
			goinfo(item){
				if(this.type==1){
					uni.navigateTo({
						url: "/hotelAdmin/my/pay/pay?hotel_id=" + item.id
					})
				}else{
					uni.navigateTo({
						url: "/hotelAdmin/my/deposit/deposit?hotel_id=" + item.id
					})
				}
			}
		},
	}
</script>

<style lang="less">
	.xuan-item{
		width: 690rpx;
		margin: 16rpx auto;
		height: 174rpx;
		border-bottom: 1rpx solid #EDEDED;
		font-size: 32rpx;
		color: #000;
		display: flex;
		padding-top: 40rpx;
		background-color: #cfe8f9;
		    border-radius: 15rpx;
	}
	.xuan-title{
		margin-left: 22rpx;
		width: 80%;
	}
	.xuan-address{
		font-size: 26rpx;
		margin-top: 20rpx;
	}
	.ellipsis1{
		overflow: hidden;
		white-space: nowrap; /* 防止文字换行 */
		text-overflow: ellipsis;
	}
	.xuan-info{
		width: 80rpx;
		text-align: center;
		line-height: 132rpx;
		font-size: 28rpx;
		color: #A2A2A2;
	}
	.quan{
		width: 100rpx;
		height: 100rpx;
		border-radius: 13rpx;
		overflow: hidden;
		image{
			width: 100%;
			height: 100%;
		}
	}
</style>